﻿using Netium.Compiler.IntermediateRepresentation;

namespace CFrontEnd
{
    partial class cLexer
    {
        public override Antlr.Runtime.IToken Emit()
        {
            var token = new IRToken(input, state.type, state.channel, state.tokenStartCharIndex, CharIndex - 1);
            token.Line = state.tokenStartLine;
            token.Text = state.text;
            token.CharPositionInLine = state.tokenStartCharPositionInLine;

            Emit(token);
            return token;
        }

        public override Antlr.Runtime.IToken GetEndOfFileToken()
        {
            return new IRToken(base.GetEndOfFileToken());
        }
    }
}
